home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 5.5 KB | 172 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWDscOpr.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: © 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWDSCOPR_H
- #include "FWDscOpr.h"
- #endif
-
- #ifndef FWDESC_H
- #include "FWDesc.h"
- #endif
-
- #ifndef FWSCPTBL_H
- #include "FWScptbl.h"
- #endif
-
- //========================================================================================
- // Runtime Information
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwsemevt2
- #endif
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << FW_CDesc&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, const FW_CDesc& other)
- {
- desc.PutDataByDesc(other);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> FW_CDesc&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, FW_CDesc& other)
- {
- other = desc;
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << ODDescType&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, ODDescType typeValue)
- {
- desc.PutDataByPtr(typeType, &typeValue, sizeof(ODDescType));
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> ODDescType&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, ODDescType& typeValue)
- {
- desc.GetDataByPtr(typeType, &typeValue, NULL, sizeof(ODDescType));
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << long&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, long value)
- {
- desc.PutDataByPtr(typeLongInteger, &value, sizeof(value));
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> long&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, long& value)
- {
- desc.GetDataByPtr(typeLongInteger, &value, NULL, sizeof(value));
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << FW_CColor&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, const FW_CColor& color)
- {
- desc.PutColor(color);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> FW_CColor&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, FW_CColor& color)
- {
- desc.GetColor(color);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << FW_CPoint&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, const FW_CPoint& thePoint)
- {
- desc.PutPoint(thePoint);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> FW_CPoint&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, FW_CPoint& thePoint)
- {
- desc.GetPoint(thePoint);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& << FW_CRect&
- //---------------------------------------------------------------------------------------
-
- FW_CDesc& operator<< (FW_CDesc& desc, const FW_CRect& rect)
- {
- desc.PutRect(rect);
- return desc;
- }
-
- //---------------------------------------------------------------------------------------
- // operator FW_CDesc& >> FW_CRect&
- //---------------------------------------------------------------------------------------
-
- const FW_CDesc& operator>> (const FW_CDesc& desc, FW_CRect& rect)
- {
- desc.GetRect(rect);
- return desc;
- }
-
-
- //----------------------------------------------------------------------------------------
- // FW_InsertScriptableIntoDesc
- //----------------------------------------------------------------------------------------
-
- void FW_InsertScriptableIntoDesc(FW_MScriptable* scriptable, FW_CDesc& desc)
- {
- desc.PutDataByPtr(FW_kSemanticObjectTokenType, &scriptable, sizeof(scriptable));
- scriptable->AcquireScriptable();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_ExtractScriptableFromDesc
- //----------------------------------------------------------------------------------------
-
- FW_MScriptable* FW_ExtractScriptableFromDesc(const FW_CDesc& desc)
- {
- FW_MScriptable* scriptable;
-
- desc.GetDataByPtr(FW_kSemanticObjectTokenType, &scriptable, NULL, sizeof(scriptable));
- return scriptable;
- }
-